class Duration {
    private int hours;
    private int minutes;
    private int seconds;
    // 三参构造器
    public Duration(int hours, int minutes, int seconds) {
        this.hours = hours;
        this.minutes = minutes;
        this.seconds = seconds;
    }
    // 一参构造器
    public Duration(int totalSeconds) {
        hours = totalSeconds / 3600;
        minutes = (totalSeconds % 3600) / 60;
        seconds = totalSeconds % 60;
    }
    // get方法
    public int getHours() {
        return hours;
    }
    public int getMinutes() {
        return minutes;
    }
    public int getSeconds() {
        return seconds;
    }
    // 获取总秒数的方法
    public int getTotalSeconds() {
        return hours * 3600 + minutes * 60 + seconds;
    }
    // 重写toString方法
    @Override
    public String toString() {
        return hours + ":" + minutes + ":" + seconds;
    }
}